package com.archermind.nfc.client.service.impl;

import android.util.Log;

import com.archermind.nfc.client.service.AbstractService;
import com.archermind.nfc.common.model.Message;
import com.archermind.nfc.common.utils.MessageGenerator;

public class TestService extends AbstractService implements ITestService {

	public void testService() {
		Message message = MessageGenerator.newMessage("LOAD_CARTE_BY_ID",
				"PHONE_123456", "NFC_123456");
		sendMessage(message);

		Message replyMessage = waitMessage(message);

		if (replyMessage == null) {
			Log.e("TestService", "Wait reply message timeout");
			return;
		}

		Log.d("TestService", "Client received: " + replyMessage.getAction()
				+ ", " + replyMessage.getData("ret"));
	}

}
